package com.woniu.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.sql.Time;
import java.time.LocalDateTime;
import java.time.LocalTime;

@Data
@ApiModel("更改开业时间数据")
public class StoreOpenTimeForm {
    @Min(value = 1, message = "店铺id必须为正整数")
    @Max(value = 999, message = "店铺id不能超过3位")
    @ApiModelProperty("店铺ID")
    private Long storeId;

    @NotNull(message = "开始营业时间不能为空")
    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @ApiModelProperty("更改后的开始营业时间")
    private LocalTime storeStartTime;

    @NotNull(message = "结束营业时间不能为空")
    @JsonFormat(pattern = "HH:mm:ss")
    @DateTimeFormat(pattern = "HH:mm:ss")
    @ApiModelProperty("更改后的结束营业时间")
    private LocalTime storeEndTime;
}